ci: restore xdist coverage reporting#70
Merged
Merged
Conversation
Run pytest-cov inside xdist workers so Codecov receives real hit data instead of a coordinator-only 0% report. Align the local project floor with Codecov's existing 80% target, fail the job on upload errors, and restore the supported monthly PyPI downloads badge.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
maltsev-dev
added a commit
that referenced
this pull request
Jul 21, 2026
* ci: neutralise time.sleep in test code for coverage runs Sprint 0 (coverage). Coverage is now reported correctly via pytest-cov + xdist, but a handful of TestCircuitBreaker tests use bare time.sleep(1.1) to wait out the 1.0s recovery_timeout. That was a 3.3-second tax per worker on every xdist run, and the suite could not be collected on Windows in a reasonable time without the cap. The conftest autouse fixture _fast_sleep caps test sleeps at 1ms, which is well above the cancellable-wait regression threshold (0.05s) and zero impact on retries (the existing per-test monkeypatch covers the time.monotonic path). Three TestCircuitBreaker tests now advance the wall clock via _advance_clock(monkeypatch) instead of sleeping, so the recovery transition fires deterministically. Opt-out: @pytest.mark.slow_sleep on a test class keeps the real wall clock (e.g. test_ping_chain_emits_heartbeats_on_time_schedule needs real-time progression for the scheduler thread). Verified: 1237 passed, 7 skipped, 29 warnings in 34.92s; combined coverage 80.98% (vs 79.26% on master 29caae9). * chore(release): 0.13.12 — CI / coverage-testability Bump SDK 0.13.11 -> 0.13.12. CI scope only — no on-wire change, no SDK_MIN_VERSION bump, no public API change. Backends on 1.0.0 keep working unchanged. Pyproject version + __version__ + CHANGELOG entry. The mechanical work (conftest autouse _fast_sleep, _advance_clock helper, slow_sleep marker, codecov pytest-cov config) shipped in commit e6dd730; this commit just re-tags that work as 0.13.12 so the published wheel exposes the new version string. Verified: 1237 passed, 7 skipped, 29 warnings; combined coverage 80.87% (vs master 29caae9 79.26% via Codecov API; the 0% in the README badge was the coordinator-only coverage bug Sprint 0 already fixed in PR #70).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
coverage run -m pytest -n autotraced only the pytest coordinator. Tests executed in xdist workers, so Codecov received a report with zero hits even though the suite passed.Verification
pytest -n auto --cov=src/nullrun --cov-branch --cov-report=xml:coverage.xml --cov-report=term: 1237 passed, 7 skipped; 80.87% combined coverage; required 80% reachedruff check src/: passedmypy src/: passedgit diff --check: passeddownloads: 370/monthRelease impact
No runtime/package behavior change. This is CI and README metadata only, so no package version bump or release changelog entry is required.